package com.vast.ui.component.models;

public class ItemArray {
	public Item itemArray[];
	public int  lineNumber;
	
	public ItemArray(int numberOfColumn, int initialValue) {
		itemArray = new Item[numberOfColumn];
		
		for(int i = 0; i < numberOfColumn; i++) {
			itemArray[i] = new Item(initialValue);
		}
	}
	
	public void putLineNumber(int line) {
		this.lineNumber = line;
	}
	
	public int getLineNumber() {
		return lineNumber;
	}
	
	public Item getItem(int index){
		return itemArray[index];
	}
	
	public int size() {
		return itemArray.length;
	}
	
	public int decodeToBinary() {
		int decodedValue = 0;
		for (int i = 0; i < itemArray.length; i++) {
			decodedValue |= ((0x1 & itemArray[i].value) << i);
		}
		return decodedValue;
	}
}
